package com.qc.toutiao.services.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;

import com.qc.toutiao.dao.CategoryMapper;
import com.qc.toutiao.services.CategoryService;
import com.qc.toutiao.util.SessionUtil;

public class CategoryServiceImpl implements CategoryService {
	private SessionUtil sesionUtil = new SessionUtil();
	private SqlSession session;
	
	private CategoryMapper categoryMapper;

	public CategoryServiceImpl() {
		session = sesionUtil.getSession();
		categoryMapper = session.getMapper(CategoryMapper.class);

	}

	@Override
	public List<Map<String, Object>> findCategoryAll() {
		List<Map<String, Object>> list = categoryMapper.findCategoryAll();

		sesionUtil.closeSession(session);

		return list;
	}

}
